#include "widget.h"
#include "document.h"
#include "child_info.h"
#include "check.h"
#include "add_new.h"
#include "screen_part.h"
#include "guid_page.h"
#include "soft_set.h"
#include "data_mange.h"
#include "data_mange_check.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    document doc;
    child_info child;
    check ch;
    add_new ad;
    Screen_part s;
    guid_page g;
    soft_set set;
    data_mange d;
    data_mange_check manc;

    /*
     * 信号绑定部分
     */
    QApplication::connect(&w, SIGNAL(show_doc()), &doc, SLOT(display_soft_doc()));
    QApplication::connect(&w, SIGNAL(show_child_info()), &child, SLOT(display_child_info()));
    QApplication::connect(&child, SIGNAL(open_info(int)), &ch, SLOT(get_id(int)));
    QApplication::connect(&child, SIGNAL(open_new()), &ad, SLOT(display_add()));
    QApplication::connect(&child, SIGNAL(open_test(int, QString)), &s, SLOT(do_test(int, QString)));
    QApplication::connect(&s, SIGNAL(Guidance(int)), &g, SLOT(display(int)));
    QApplication::connect(&w, SIGNAL(show_setting()), &set,SLOT(display_setting()));
    QApplication::connect(&w, SIGNAL(show_data()), &d, SLOT(display_date()));
    QApplication::connect(&d, SIGNAL(show_detail(int)), &manc, SLOT(display_date_check(int)));
    QApplication::connect(&d, SIGNAL(want_print(int)), &manc, SLOT(display_print(int)));
    QApplication::connect(&ch, SIGNAL(show_screen(int,QString)), &s, SLOT(do_test(int,QString)));
    QApplication::connect(&manc, SIGNAL(child_close()), &d, SLOT(show()));
    w.show();
    return a.exec();
}
